package com.jy.unkown.page;

import android.app.Activity;
import android.view.View;

import android.widget.TextView;

import androidx.annotation.NonNull;

import com.amjy.dsl.R;
import com.jy.common.base.BaseDialog;
import com.jy.utils.call.NoDoubleClick;


public class AskDialog extends BaseDialog {
    Activity mActivity;

    public AskDialog(@NonNull Activity activity) {
        super(activity);
        this.mActivity = activity;
    }

    public interface DialogInterface {
        void dismiss();

        void exit();
    }

    DialogInterface dialogInterface;

    public void setDialogInterface(DialogInterface dialogInterface) {
        this.dialogInterface = dialogInterface;
    }

    String msg;

    public void setTips(String tips) {
        msg = tips;
    }

    @Override
    public void initUI() {
        {
            View jixuguankan = findViewById(R.id.jixuguankan);
            jixuguankan.setOnClickListener(new NoDoubleClick() {
                @Override
                public void noDoubleCall(View view) {
                    dialogInterface.dismiss();
                    dismiss();
                }
            });
        }
        {
            View jixuguankan = findViewById(R.id.jianchituichu);
            jixuguankan.setOnClickListener(new NoDoubleClick() {
                @Override
                public void noDoubleCall(View view) {
                    dismiss();
                    dialogInterface.exit();
                }
            });
        }
        {
            TextView textView = findViewById(R.id.textView);
            textView.setText(msg);
        }

    }

    @Override
    public int layoutId() {
        return R.layout.ask_unkown_dialog;
    }
}
